<!DOCTYPE html>
<html>

	<head>
		<meta charset="UTF-8">
		<title>地震局培训平台</title>
		<!--<link rel="stylesheet" href="bootstrap/css/bootstrap.css" />-->
		<link rel="stylesheet" href="style/main.css" />
		<link rel="stylesheet" href="style/details_project.css" />
	</head>

	<body>
		<div id="info">
			<div class="info">
				<div class="newsbox">
					<!--消息滚动-->
					<div class="news nowrap">消息：欢迎加入地震应急志愿者培训平台，您是第123456位访问用户。</div>
				</div>
				<div class="infobox">
					<div class="name nowrap">zhangming</div>
					<div class="info_id nowrap">N.8784547</div>
					<div class="sign_out">退出</div>
				</div>
				<div class="leave_m">互动留言</div>
			</div>
		</div>
		<div id="show">
			<nav id="nav">
				<div class="top">
					<div class="logo"></div>
					<div class="seachbox">
						<input type="text" id="search" value="在线课堂搜索" />
						<div class="weibo codeIcon">
							<div class="first">
								<img src="image/weiboCode.png" />
							</div>
						</div>
						<div class="weixin codeIcon">
							<div class="first">
								<img src="image/weixinCode.png" />
							</div>
						</div>
					</div>
				</div>
				<div class="border">
					<ul class="nav">
						<li data-url="index">首页</li>
						<li data-url="news">新闻资讯</li>
						<!--<li data-url="story">志愿故事</li>-->
						<li class="in" class="team">志愿品牌
							<div class="first">
								<div class="in" data-url="story">志愿故事</div>
								<div data-url="team">志愿团体</div>
								<div data-url="star">志愿之星</div>
							</div>
						</li>
						<!--<li data-url="project">志愿项目</li>
						<li data-url="star">志愿之星</li>-->
						<li data-url="train">培训平台</li>
						<li data-url="policy">志愿政策</li>
					</ul>
				</div>
			</nav>

			<!--<div id="position">
				您所在的位置：首页>培训平台>正文
			</div>-->

			<div id="content">
				<div class="left">
					<div class="detailsbox">
						<div class="title">【1569532】 我为平安做贡献</div>
						<div class="details">
							<div class="img"><img src="" /></div>
							<div class="box">
								<div class="text address">区域：<span>昌平区</span></div>
								<div class="text">详细地址：<span>昌平区</span></div>
								<div class="text object">人员规模：<span>100</span></div>
								<div class="text time1">正式成员：<span>80</span></div>
								<div class="text time2">成立日期：<span>2018-07-30至2019-07-29</span></div>
								<div class="text time3">加入方式：<span>拒绝任何人加入</span></div>
								<div class="text time4">联系团体：<span>靖安建设服务队</span></div>
								<div class="text share">团体分享到：
									<div class="qq"></div>
									<div class="weibo2"></div>
									<div class="weixin2"></div>
								</div>
							</div>
						</div>
					</div>
					<div class="navbar2">
						<div class="titlebox">
							<div class="title in">团队简介</div>
							<div class="title">相关项目</div>
						</div>
						<div class="text">平安宣传 上街维护交通秩序</div>
					</div>
				</div>
				<div class="right">
					<div class="border"></div>
					<!--<div class="rightbox">
						<div class="title">项目二维码</div>
						<div class="code"></div>
						<div class="text3">APP扫描二维码加入项目</div>
					</div>-->
					<div class="rightbox">
						<div class="title">团体联系人</div>
						<div class="name">李威武</div>
						<div class="phone">手机：<span>17710694807</span></div>
						<div class="e-mail">邮箱：<span>165495601@qq.com</span></div>
						<div class="btnbox">
							<div class="btn2"></div>
						</div>
					</div>
					<div class="rightbox">
						<div class="title">团体地址</div>
						<div class="address">昌平区</div>
					</div>
				</div>
			</div>
		</div>
		<div id="bottom">
			<ul class="border">
				<li>相关协作单位：</li>
				<li>中国红十字会</li>
				<li>中科院心理所</li>
				<li>中国地震信息网</li>
				<li>中国地震科普网</li>
				<li>北京市地震局科普网 </li>
				<li>科普网</li>
			</ul>
			<div class="bottom">
				<ul class="one">
					<li>设为首页</li>
					<li>交换链接</li>
					<li>关于我们</li>
					<li>联系我们</li>
					<li>常见问题</li>
					<li>心理教室</li>
					<li>党团建设</li>
				</ul>
				<ul class="two">
					<li>主办：北京市地震局</li>
					<li>版权所有 京ICP备08988239</li>
					<li>技术支持：中宣助力传媒</li>
				</ul>
			</div>
		</div>
		<script type="text/javascript" src="script/jquery.min.js"></script>
		<script type="text/javascript" src="script/ishoock.tools.js"></script>
		<script type="text/javascript" src="script/common.js"></script>
		<script type="text/javascript" src="script/main.js"></script>
		<script>
			$(function(){
							
							
			 var turl = decodeURI(window.location.href);
				var projectid = getUrlParam("id", turl);
				// 点击项目区域详情信息数据请求
				$.ajax({
					type: "GET",
			        url: host + "volunteerTeam/getVolunteerTeamByid/"+projectid,
			        dataType: "json",
			        success: function(data){
								console.log(data)
								var showimg = '';
								if(item.imageUrl != null ){
									showimg = 'http://101.201.113.151:9000'+data.showImage.split('ROOT')[1] ;
								}
								
								$('.details .img').children('img').attr('src',showimg)
								// 赋值
								for (var m in data) {
			       			$(".detailsbox ."+m).text(data[m]);
			       		}
								//右侧项目联系人发起人赋值
								for (var m in data) {
									$("#content .right  ."+m).text(data[m]);
								}
								
								$.each(data.stations,function(index,item){
									console.log(item) 
								/* ctId = item.projectId;
									stationId += item.id+','; */
									$('.Add_signupbox').append('<div class="signupbox">'+
									                              
																								'<div class="top">'+
																									'<div class="">岗位：<span>'+item.stationName+'</span></div>'+
																									'<div class="">计划招募：<span>'+item.planSignNum+'</span></div>'+
																									'<div class="">已招募：<span>'+item.signNum+'</span></div>'+
																									'<div class="signupbtn">'+
																									    '<input type="hidden" value="'+projectid+'" class="userId">'+
																									    '<input type="hidden" value="'+item.projectId+'" class="projectId">'+
																									    '<input type="hidden" value="'+item.id+'" class="stationId">'+
																									'</div>'+
																								'</div>'+
																								'<div class="middle">'+
																									'<div class="">'+
																										'<i>岗位ID：</i>'+
																										'<span>'+item.id+'</span>'+
																									'</div>'+
																									'<div class="">'+
																										'<i>岗位描述：</i>'+
																										'<span>'+item.stationDesc+'</span>'+
																									'</div>'+
																									'<div class="">'+
																										'<i>岗位条件：</i>'+
																										'<span>'+item.stationConds+'</span>'+
																									'</div>'+
																								'</div>'+
																							'</div>')
									
								})
								
							$('.signupbtn').on('click',function(){
									var userid = $(this).children('.userId').val();
									var projectId = $(this).children('.projectId').val();
									var stationId = $(this).children('.stationId').val();
									
									$.ajax({
										type:"get",
										url:"http://101.201.113.151:9230/volunteerProject/signProject/"+userid+"/"+projectId+"/"+stationId,
										async:true,
										dataType:"json",
										success:function(data){
											console.log(data)
											if(data.code == "success"){
												alert("申请成功 请等待审核")
											}
										}
									})
									
								})
								
								
								
								
								
						
						
					}
			 
				})
				
			})
		</script>
	</body>

</html>